<template>
    <div class="container">
        <h1>部门列表</h1>
        <ul class="list-group">
            <li class="list-group-item" v-for="dept in departments" @click="click">{{ dept.name }}</li>
        </ul>
    </div>
</template>

<script>
    export default{
        data: function(){
            return{
                departments: [
                    {id:1,name:"dept1"},
                    {id:2,name:"dept2"},
                    {id:3,name:"dept3"},
                    {id:4,name:"dept4"},
                    {id:5,name:"dept5"},
                    ]
            }
        },
        methods:{
            click(){
                alert("clicked!")
            }
        }
    }
</script>

<style scoped>

</style>